//
//  ViewController.m
//  OpenCVDemo
//
//  Created by zrf on 2021/7/6.
//

#import "ViewController.h"
#import "CBridging.h"
#import "RFTest.h"
#import <objc/runtime.h>
#import "Test1ViewController.h"
#import "SubViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imgv;

@end

@implementation ViewController
+ (void)load{
    NSLog(@"主类的load");
}
+ (void)initialize
{
    if (self == [SubViewController class]) {
        NSLog(@"主类ViewController-initialize");
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [_imgv addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgvClicked:)]];
    _imgv.image = [UIImage imageNamed:@"20.jpeg"];
    
    RFTest *obj1 = [RFTest new];
    Class obj2 = [RFTest class];
    Class metaClass = object_getClass(obj2);
    
}

- (void)imgvClicked:(UIGestureRecognizer*)tap{
//    Test1ViewController *vc = [Test1ViewController new];
    SubViewController *vc = [SubViewController new];
    [self presentViewController:vc animated:YES completion:nil];
//    NSData *data = UIImageJPEGRepresentation(_imgv.image, 1);
//    UIImage *image = _imgv.image;//[UIImage imageWithData:data];
//    NSLog(@"开始处理:图片大小%.0f*%.0f. 图片内存%luk", image.size.width, image.size.height, data.length/1024);
//    _imgv.image = [CBridging enhance:image];
//    NSLog(@"完成处理");
}
@end
